function GetRTime(id,timeId){
	
	var endTime=$("#"+timeId).val();
	
    var year=endTime.substring(0,4);
    var moth=endTime.substring(5,7);
	var day=endTime.substring(8,10);
	var hour=endTime.substring(11,13);
	var mm=endTime.substring(14,16);
	var ss=endTime.substring(17,19);
	
 var EndTime = new Date(year,moth-1,day,hour,mm); //截止时间:2010年10月1日0时0分
    var NowTime = new Date();
    var nMS = EndTime.getTime() - NowTime.getTime();
    var leftsecond = parseInt(nMS/1000);   
	
	 var day0 = parseInt(leftsecond / (24 * 60 * 60));
    var day=Math.floor(leftsecond/(60*60*24)); 
    var hour=Math.floor((leftsecond-day*24*60*60)/3600); 
    var minute=Math.floor((leftsecond-day*24*60*60-hour*3600)/60); 
    var second=Math.floor(leftsecond-day*24*60*60-hour*3600-minute*60); 
  
	var time=day0+"天"+hour+"小时"+minute+"分"+second+"秒";
		//alert(id+":"+time);
		$("#"+id).html(time); 
    setTimeout("GetRTime('"+id+"','"+timeId+"')", 1000);
}
function timeStr(endTime)
{
	
	 var Today = new Date();    
    var NowHour = Today.getHours();    
    var NowMinute = Today.getMinutes();    
    var NowMonth = Today.getMonth();    
    var NowDate = Today.getDate();    
    var NowYear = Today.getFullYear();    
    var NowSecond = Today.getSeconds();    
  
  var year=endTime.substring(0,4);
    var moth=endTime.substring(5,7);
	var day=endTime.substring(8,10);
	var hour=endTime.substring(11,13);
	var mm=endTime.substring(14,16);
	var ss=endTime.substring(17,19);
	
    var fdate=new Date(year,moth,day,hour,mm);  
    var Hourleft = fdate.getHours() - NowHour;  
    var Minuteleft = fdate.getMinutes() - NowMinute;    
    var Secondleft = fdate.getSeconds() - NowSecond;    
    var Yearleft = fdate.getFullYear() - NowYear;    
    var Monthleft = fdate.getMonth() - NowMonth - 1;    
   var Dateleft = fdate.getDate() - NowDate;   
    if (Secondleft<0){    
        Secondleft=60+Secondleft;    
        MinuteleftMinuteleft=Minuteleft-1;    
    }    
    if (Minuteleft<0){     
        Minuteleft=60+Minuteleft;    
        HourleftHourleft=Hourleft-1;    
    }    
    if (Hourleft<0){    
        Hourleft=24+Hourleft;    
        DateleftDateleft=Dateleft-1;    
    }    
    if (Dateleft<0){    
        Dateleft=31+Dateleft;    
        MonthleftMonthleft=Monthleft-1;    
    }    
    if (Monthleft<0){    
        Monthleft=12+Monthleft;    
        YearleftYearleft=Yearleft-1;    
    }    
var time=Dateleft+"天"+Hourleft+"小时"+Minuteleft+"分"+Secondleft+"秒";
return time;
}
